import { Router } from "express";
import { user } from "../../../modules";

const router = Router();

router.post("/", async (req, res: any) => {
  try {
    console.log(req.body);
    const { username, password, phone } = req.body;
    const result = await user.create({ username, password, phone });
    if (result) {
      res.send({
        status: 200,
        message: "注册成功",
      });
    }
  } catch (error: any) {
    res.cc(error.message);
  }
});
export default router;
